<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>vue and axios and promise</title>
		<script src="./vue.js"></script>
		<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
	</head>
	<body>
		<div id="app">
			<ul type="none">
				<li v-for="item in types">
					<span>{{item.sidu}}</span><span>{{item.style}}</span>
					<span>{{item.addtime}}</span>
				</li>
			</ul>
		</div>
		<script>
		 var vm=new Vue({
			 el:'#app',
			 data:{
				 types:[]
			 },
			 mounted() {
			 	axios.get("http://localhost:8886/type/search").then(res=>{
					console.log(res);//res.data是ajax返回的数据。。。
					this.types=res.data.data;
					
				}).catch(err=>{
					alert("error:"+err);
				});
			 }
		 })
		</script>
	</body>
</html>
